import request from '../utills/request'

//封装 删除文章 接口
export const deleteArticles = (id) => {
  return request.delete(`/v1_0/mp/articles/${id}`)
}

//封装 添加文章 接口
export const addArticle = (params, draft) => {
  return request.post(`/v1_0/mp/articles?draft=${draft}`, params)
}

//封装 获取文章信息 接口
export const getArticleInfo = (id) => {
  return request.get(`/v1_0/mp/articles/${id}`)
  // /v1_0/mp/articles/:target
}

//封装 修改文章 接口
export const reviseArticle = (id, draft, body) => {
  return request.put(`/v1_0/mp/articles/${id}?draft=${draft}`, body)
  // /v1_0/mp/articles/:target
}
